package com.wimcorp.magic.board;

import com.wimcorp.magic.cards.PlayingCard;
import com.wimcorp.magic.input.Location;
import com.wimcorp.magic.players.Player;

public abstract class CardAccessor {
	public abstract PlayingCard getCard(long identifier);
	
	public static CardAccessor getCardAccessor(Player player, String location) {
		CardAccessor cardAccessor = null;
		switch (Location.valueOf(location)) {
		case BATTLEFIELD:
			cardAccessor = player.getSummoningPlaines();
			break;
		case DECK:
			cardAccessor = player.getDeck();
			break;
		case EXILE:
			cardAccessor = player.getSummoningPlaines().getExile();
			break;
		case GRAVEYARD:
			cardAccessor = player.getSummoningPlaines().getGraveyard();
			break;
		case HAND:
			cardAccessor = player.getHand();
			break;
		case STACK:
			cardAccessor = player.getStack();
			break;
		}
		return cardAccessor;
	}

	public abstract void remove(PlayingCard card);
}
